<?php defined('TSTP_VERSION') or die('forbidden');


/**
* MLT Web Engine
* http://www.molotsoft.ru
*
* @package MLT_WE
* @subpackage Test_Types
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: date.tstp.php 158 2009-03-07 08:47:44Z molotsoft@gmail.com $
* @link $HeadURL: http://test-types.googlecode.com/svn/tags/2.0.1/types/datetime/date.tstp.php $
*/


define('TSTP_DATE_ISO_PATTERN', '~^(\d{4})-(\d{2})-(\d{2})$~');

function tstp_date($var) {
	return (bool)preg_match(TSTP_DATE_ISO_PATTERN, $var, $match) ? (tstp_year($match[1]) && tstp_month($match[2]) && tstp_day($match[3]) && checkdate($match[2], $match[3], $match[1])) : FALSE;
}


?>